package com.allenkerr.model;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * Created by 小柯 on 2017/10/16.
 */
@Document(collection = Todo.COLLECTION_NAME)
public class Todo {

  public static final String COLLECTION_NAME = "todo";

  @Id
  private Long id;
  private String task;
  private Boolean done;

  public Todo() {
  }

  public Todo(String task, Boolean done) {
    this.task = task;
    this.done = done;
  }

  public Todo(Long id, String task, Boolean done) {
    this.id = id;
    this.task = task;
    this.done = done;
  }

  @Override
  public String toString() {
    return "Todo{" +
            "id=" + id +
            ", task='" + task + '\'' +
            ", done=" + done +
            '}';
  }

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public String getTask() {
    return task;
  }

  public void setTask(String task) {
    this.task = task;
  }

  public Boolean getDone() {
    return done;
  }

  public void setDone(Boolean done) {
    this.done = done;
  }
}
